/*
 * Copyright (c) 2013, Ivan Babushkin.
 */
package asngen.codec;

import asngen.core.*;
import java.io.*;

public final class MderEncoder implements Encoder {
    private OutputStream os;
    private DataOutputStream dos;

    public MderEncoder(OutputStream os) {
        this.os = os;
        dos = new DataOutputStream(os);
    }

//    @Override
//    public void encode(AsnInteger v) throws IOException {
//        int length = v.length();
//        long value = v.getValue();
//        switch (length) {
//            case 1: dos.writeByte((byte)value); break;
//            case 2: dos.writeShort((short)value); break;
//            case 3:
//            case 4: dos.writeInt((int)value); break;
//            default: throw new UnsupportedOperationException();
//        }
//    }

    public void encode(AsnInteger v) throws IOException {
        new IntegerEncoder(dos, v).encode();
    }

    private class IntegerEncoder extends IntegerEncoderRuntime {
        public IntegerEncoder(DataOutputStream dos, AsnInteger value) {
            super(dos, value);
        }

        public void encode() throws IOException {

        }
    }


}

